Animate = {
	initAnimate:function(){
		$('#logo').css({
			top:($(window).height() - $('#logo').height())/2,
			left:($(window).width() - $('#logo').width())/2
		});

		$('#lighttop').css({
			left:($(window).width() - $('#lighttop').width())/2
		});

		$('#light1').css({
			top:($(window).height() - $('#light1').height())/2,
			left:($(document).width() - $('#light1').width())/2
		});

		$('#cloud').css({
			left:($(window).width() - $('#cloud').width())/2,
			top:($(document).height() - $('#cloud').height())/2
		});
		
		$('#airplane').css({
			top:$(document).height()/2 - $('#airplane').height(),
			left:$(document).width(),
			opacity:1
		});
		
		$('#mainlink').css({
			top:$(document).height()/2,
			left:($(window).width() - $('#mainlink').width())/2
		});
	},
	playAnimate:function(){
		$('#lighttop, #light1').animate({
			opacity:1
		},2000);
		
		setTimeout(function(){// show cloud
			$('#cloud').animate({
				opacity:1,
				top:$('#cloud').position().top - 40,
			},1500);
		},1700);
			
		setTimeout(function(){// show logo and move airplane
			$('#logo').animate({
				opacity:1,
				top :$('#logo').position().top - 200
			},4000);

			$('#mainlink').animate({
				opacity:1,
				top :$('#mainlink').position().top  + 100
			},4000);

			//airplane animate
			$('#airplane').animate({
				left :-$('#airplane').width()*2
			},4500);		
		},2500);
	},
	resize:function(){
		$('#mainlink').css({
			top:$(window).height() * 0.66 ,
			left:($(window).width() - $('#mainlink').width())/2
		});
		$('#logo').css({
			left:($(window).width() - $('#logo').width())/2
		});
	}
}

$(function(){
	Animate.initAnimate();
	setTimeout(Animate.playAnimate,10);
	$(window).resize(Animate.resize);
});